<html>

<head>
    <link type="text/css" rel="stylesheet" href="/stylesheets/plainold.css" />
</head>

<H4><a href="{{logout_url}}">{{logout_txt}}</a> <b>{{user}} - iRun</b> 
<a href="/">Home</a>
<a href="charts">My Charts</a>
</H4>

<body>

<form method="get" action="/add">
<input type="submit" value="Email CSV">  
</form>

<form method="get" action="/stats">
Sort by:
<select name="sort">
<option>activity</option>
<option>date</option>
<option>distance</option>
<option>energy</option>
<option>hr</option>
<option>pace</option>
<input type="submit" value="Sort">
</select>
</form>

<table border="1.5">
  <tr style="text-align:center">
    <th>#</th>
    {% for header in headers %}
    <th>{{header}}</th>
    {% endfor %}
    <th>Action</th>
  </tr>
{% for run in user_runs %}
  <tr>
    <td style="text-align:center">{{forloop.counter}}</td>
    <td style="text-align:center">{{run.date}}</td>
    <td style="text-align:center">{{run.duration}}</td>
    <td style="text-align:center">{{run.distance}}</td>
    <td style="text-align:center">{{run.pace}}</td>
    <td style="text-align:center">{{run.pace_max}}</td>
    <td style="text-align:center">{{run.hr}}</td>
    <td style="text-align:center">{{run.hr_max}}</td>
    <td style="text-align:center">{{run.energy}}</td>
    <td style="text-align:center">{{run.te}}</td>
    <td style="text-align:center">{{run.activity}}</td>
    <td style="text-align:center"><a href="/edit?id={{run.key}}">Edit</a>  <a href="/delete?id={{run.key}}">Delete</a></td>
  </tr>
{% endfor %}

</body>
</html>
